<%= header %>
<%= boomerangScript %>
<script src="../../vendor/angular/angular.js"></script>
<script src="../../vendor/angular-resource/angular-resource.js"></script>
<script src="../../vendor/angular-route/angular-route.js"></script>
<script src="support/app.js"></script>
<div ng-app="app">
	<div ng-view>
	</div>
</div>
<script src="/test-templates/spa/09-autoxhr-after-load.js" type="text/javascript"></script>
<script src="09-autoxhr-after-load.js" type="text/javascript"></script>
<script>
window.angular_imgs = [-1];

var xhr;

var beaconNum = 0;
BOOMR.subscribe("beacon", function() {
	if (!BOOMR.plugins.AutoXHR) {
		return;
	}

	setTimeout(function() {
		if (beaconNum === 0) {
			// first XHR
			xhr = new XMLHttpRequest();
			xhr.open("GET", "/delay?delay=3000&file=/pages/05-angular/support/widgets.json&id=1&rnd=" + Math.random(), true);
			xhr.send(null);
		}
		else if (beaconNum === 1) {
			xhr = new XMLHttpRequest();
			xhr.open("GET", "/delay?delay=1000&file=/pages/05-angular/support/widgets.json&id=2&rnd=" + Math.random(), true);
			xhr.send(null);
		}
		beaconNum++;
	}, 100);
});

BOOMR_test.init({
	testAfterOnBeacon: BOOMR.plugins.AutoXHR ? 3 : 1,
	Angular: {
		enabled: true
	},
	instrument_xhr: true,
	autorun: false
});
</script>
<%= footer %>
